﻿@model IEnumerable<PNProject.EF.Category>
<ul>
    @foreach (var cat in @Model)
    {
        <li><a href="@Url.Action("Index", "Products", new { id = @cat.CategoryID })" onclick="clickSubItem(this);">@cat.CategoryName</a>
            @if (cat.Products.Any())
            {
                <ul>
                    @foreach (var pro in cat.Products)
                    {
                        <li> <a href="@Url.Action("Index","ProductDetails",new {CatelogId = @pro.CategoryID,id = @pro.ProductID})">@pro.Name</a></li>
                    }
                </ul>
            }
        </li>
    }
   
</ul> 
